<?php
/**
 * Interface to add/remove classrooms from the system
 */
?>
<html>
<head>
<?php
require_once '../dbms_university_courses_mvc/Model/model_require_once.php';
?>
</head>
<body>
<h2>University Classrooms</h2>
<?php
$classrooms = Classroom::getClassrooms ();
Classroom::instantiate_javascript_objects($classrooms);
?>
<table>
	<tr>
		<th>Id</th>
		<th>Capacity</th>
		<th>Delete</th>
	</tr>
<?php
foreach ( $classrooms as $classroom ) {
	?>
	<tr>
		<td><?php
	echo $classroom->get_classroom_id();
	?></td>
		<td><?php
	echo $classroom->print_capacity_input_setter();
	?></td>
	<td><?php $classroom->print_delete_button(true, "refreshPage");?></td>
	</tr>
	<?php
}

//insert new class via ajax call
?>
</table>
<br><br>
<h2>Add New Classroom</h2>
<?php Classroom::print_Classroom_add("refreshPage");?>

</body>
</html>